package myNetty.action1;

/**
 * @author tonywang
 * @date 7/25/2018
 */
public class Worker {

    public void  doWrok(){
        Fetcher fetcher = new MyFetcher(new Data(1,2));
        fetcher.fetchData(new FetcherCallback() {
            @Override
            public void onData(Data data) throws Exception {
                System.out.println("Data received: " + data);
            }

            @Override
            public void onError(Throwable cause) {
                System.out.println("An error accour: " + cause.getMessage());
            }
        });
    }

    public static void main(String[] args){
        Worker worker = new Worker();
        worker.doWrok();
    }
}
